home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 1 #6
/
utv1n6s1.d64
/
wall street wiz
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
9KB
|
302 lines
0 ifa=0thena=1:load"0:wiz.ml",8,1
5 poke55,0:poke56,128:clr
10 rem(c)1987 uptime by softdisk publishing, inc
11 print"[147]":clr
13 sys52945
15 poke53280,0:poke53281,0:poke54273,25:poke54277,9:poke54278,9:poke54296,15
16 poke54280,10:poke54284,2:poke54285,0:poke54275,8
20 print"[147]":clr
60 esc=0:mt=0
70 dimtc(30),ts(30),tp(30),sp(30,7),dj(30)
75 dimsn(30,7),chg(30,7),chg$(30,7),nm$(30,7)
80 tc(0)=1000000: dj(0)=2000
90 rem
95 a$="[215]all [211]treet [215]iz"
100 cn$(1)="[203][194][205]":hp$(1)=" 14":lp$(1)=" 4"
105 sp(0,1)=9:ep$(1)=" .01":vg(1)=2:vb(1)=3
110 cn$(2)="[197][216][216][207][198][198]":hp$(2)=" 59":lp$(2)=" 43"
115 sp(0,2)=55:ep$(2)=" 2.50":vg(2)=2:vb(2)=4
120 cn$(3)="[213][194][205]":hp$(3)="150":lp$(3)=" 90":sp(0,3)=105
125 ep$(3)="10.00":vg(3)=2:vb(3)=5
130 cn$(4)="[215]izer":hp$(4)=" 70":lp$(4)=" 21"
135 sp(0,4)=60:ep$(4)=" 8.00":vg(4)=2:vb(4)=2.5
140 cn$(5)="[207]n[212]rax":hp$(5)=" 39":lp$(5)=" 14"
145 sp(0,5)=19:ep$(5)=" -0-":vg(5)=5:vb(5)=2.4
150 cn$(6)="[205]icro[195]hip":hp$(6)=" 9":lp$(6)=" 3":sp(0,6)=7
155 ep$(6)=" -0-":vg(6)=2:vb(6)=2
160 cn$(7)="[204]azer [195]orp.":hp$(7)=" 20":lp$(7)=" 2"
165 sp(0,7)=10:ep$(7)=" 1.00":vg(7)=2:vb(7)=2.4
170 rem
180 mt=0:gosub920
190 d=0:nc=7:gosub1200
200 poke214,14:print"[145]":print"[200]ere is a list of stocks with the"
202 print"year's [200]igh, [204]ow, and [195]urrent prices"
205 print"and [197]arnings per [211]hare:"
210 getsh$:ifsh$=""then210
220 ifsh$=chr$(13)thengoto250
230 ifsh$="[140]"then goto 900
240 poke54276,33:poke54276,32: goto 210
250 rem
260 gosub 1400: rem subr to buy stocks
270 rem
280 mt=2:gosub920
290 poke214,6:print"[145]":print"[212]he duration of this session of [215][193][204][204]"
292 print"[211][212][210][197][197][212] [215][201][218] is measured in days."
294 poke214,18:print"[145]":m$="[197]nter zero (0) and [[210][197][212][213][210][206]] to exit":gosub1040
300 poke214,10:print:print"[197]nter number of days (1 to 30) you'll"
302 print"be investing & press [return] -> ";:bs=1:gosub1700:dm$=wq$
304 dm=val(dm$+chr$(0)):ifasc(dm$+chr$(0))=48then:goto900
310 ifdm$=" "then290
320 if(dm<1)or(dm>30)thengosub1150:sl=21:nl=1:gosub1170:goto290
330 print"[147]":m$="[208]lease wait....."
332 gosub1040:print:m$="[212]he [215][193][204][204] [211][212][210][197][197][212] computer is working"
334 gosub1040:print:m$="on your portfolio.":gosub1040
340 ford=1todm:tc(d)=tc(d-1):ifdur>0then370
350 rn=int(1+rnd(1)*10):ifrn>4thendur=rn:goto370
360 dur=rn+6
370 dj(d)=int(dj(d-1)*(-(rn>4)*.995-(rn<5)*1.01)+10*rnd(1)-5)
375 dd=dj(d)-dj(d-1):dur=dur-1
376 forxx=1to2
377 rx(xx)=int(7*rnd(1)+1)
380 if rx(2)=rx(1)thenxx=1
390 next
400 forc=1to7:ifc=rx(1)then430
410 ifc=rx(2)then430
420 goto450
430 sn(d,c)=int(2*rnd(1)):ifsn(d,c)=0thengosub1310:goto450
440 gosub1350
450 ifsp(d-1,c)>=10then460
452 sp(d,c)=int(sp(d-1,c)*(-1.3*(dd>0)-.98*(dd<1))+(nv(c)*.5)):goto480
460 ifsp(d-1,c)<=50thengoto470
462 sp(d,c)=int(sp(d-1,c)*(-1.02*(dd>0)-.99*(dd<1))+(nv(c)*.7)):goto480
470 sp(d,c)=int(sp(d-1,c)*(-1.03*(dd>0)-.98*(dd<1))+(nv(c)*.6))
480 ifsp(d,c)<0thensp(d,c)=0
490 chg(d,c)=sp(d,c)-sp((d-1),c)
495 ifchg(d,c)<1thenchg$(d,c)=str$(chg(d,c)):goto 510
500 chg$(d,c)="+"+str$(chg(d,c)):goto520
510 if(sp((d-1),c)=0)and(chg(d,c)<0)thenchg$(d,c)="0"
520 next
530 rem
540 mt=1:gosub 920
545 print"[146]# [195]ompany [206]ame [208]/[211] [195]hg #[211]hrs [212]ot [214]al"
546 tv=0:forc=1to7
550 poke214,c+3:print"[145]":printc;tab(3);
555 print"[129]"cn$(c);:h=20:a=sp(d,c):gosub1060:print"[158]"a;
557 hx=len(chg$(d,c)):printtab(25-hx)"[159]"chg$(d,c);
559 ifns(c)<1then570
560 hx=len(ns$(c)):printtab(31-hx);
565 print"[156]"ns$(c);:tv(c)=ns(c)*sp(d,c):h=39:a=tv(c):gosub1060:print""a
567 tv=tv+tv(c)
570 nextc:poke214,10:print:printtab(31)"[192][192][192][192][192][192][192]":printtab(16)"[159][196]ay #";d
572 printtab(11)"[212]otal [211]tock [214]alue =";:h=39:a=tv
575 gosub1060:printa
580 printtab(13)"[193]vailable [195]ash =";
585 h=39:a=tc(d):gosub1060:printa
587 ifcom>0thenprinttab(11)"[211]tock commissions =";:a=com:h=39:gosub1060:printa
590 printtab(7)"[153][212]otal [208]ortfolio [214]alue =";
595 bl=tc(d)+tv:h=39:a=bl:gosub1060:printa
605 dj$="[196]ow-[202]ones [193]vg"+str$(dj(d))+"-":dd$="[206]o [195]hg"
607 print"[154]":m$="[215]all [211]t. [206]ews: ":gosub1040
610 ifdd>0thendd$="[213]p"+str$(dd):goto630
620 ifdd<0thendd$="[196]n"+str$(abs(dd))
630 dj$=dj$+dd$:m$=dj$:uy=19-len(m$)/2:forl=1touy:m$=m$+" ":next:gosub1130
640 nm$="":r=0:forn=1to7:iflen(nm$(d,n))=0thengoto680
650 nm$=cn$(n)+nm$(d,n):r=r+1
660 iflen(nm$)<38thenforw=1to38-len(nm$):nm$=nm$+".":next
670 m$=nm$:gosub1140
680 next
690 getqw$:ifqw$=""then 690
700 ifqw$=chr$(13)then800
710 ifqw$="[140]"then900
720 ifqw$="b"orqw$="[194]"then750
730 ifqw$="s"orqw$="[211]"then770
734 ifqw$="o"orqw$="[207]"thenpoke54276,65:poke54276,64
735 if(qw$="o"orqw$="[207]")andsf=1thenpoke781,23:poke782,36:poke783,48
736 if(qw$="o"orqw$="[207]")andsf=1thensf=0:sys65520:print"[149]n [146]";:goto690
737 if(qw$="o"orqw$="[207]")andsf=0thenpoke781,23:poke782,36:poke783,48
738 if(qw$="o"orqw$="[207]")andsf=0thensf=1:sys65520:print"[149]ff[146]";:goto690
740 poke54276,65:poke54276,64:goto690
750 rem
760 gosub1400:goto530
770 rem
780 gosub1540:goto530
790 sl=16:nl=5:gosub1170:gosub4800:gosub1540:goto530
800 com=0:nextd
810 rem
820 mt=2:gosub920:print:m$="[159][201][206][214][197][211][212][205][197][206][212] [211][197][211][211][201][207][206] [210][197][208][207][210][212]"
822 gosub1040:print"[195]lient's final portfolio [153]$";
824 h=39:a=bl:gosub1060:printbl
826 print"[195]lient's initial investment [150]$";:h=39:a=1000000:gosub1060:printa
830 printtab(31)"[192][192][192][192][192][192][192]"
832 print"[206]et gain or loss(-)[154]";
834 h=39:a=bl-1000000:gosub1060:printa
835 print"[158]";
840 if(a<-10000)or(a>10000)thengoto850
845 print" [217]our client expected better results!":goto890
850 if(a<-10000)or(a>100000)then860
855 print" [199][207][207][196] [202][207][194]! [217]ou get a raise of $10,000!":goto890
860 ifa<-10000then870
865 print" [211][213][208][197][210]!!! [217]ou've been promoted to [214][208]!!":goto890
870 ifa<-100000then880
875 print" [206][207][212] [212][207][207] [199][207][207][196]! [217]our boss is mad!!!!":goto890
880 print" [217]ou could lose your job!!!"
890 print"":m$="[196]o you want to invest again?":gosub1040
892 print" [197]nter [217] or [206] --> [166][157]";:gosub1080
894 poke204,255:printan$:ifan$="y"oran$="[217]"then20
900 rem
910 ifpeek(32768)=76andpeek(32769)=7andpeek(32770)=128andpeek(32771)=234then914
912 print"[147]":new
914 ifpeek(32772)<>76orpeek(32774)<>128then912
916 sys32772
920 rem
940 print"[147][149]$$$$$$$$$$$[146]";
942 printtab(11)" ";a$;" ";
944 printtab(29)"$$$$$$$$$$$[146]"
950 ifmt=1then990
960 ifmt=2then1010
970 ifmt=3then1000
980 poke214,24:print"[145]":print" [[198]8] to end";
985 print" [[210][197][212][213][210][206]] to continue[146]";:poke2023,160:poke56295,9:goto1010
990 sf$="n ":ifsf=1thensf$="ff"
992 poke214,23:print"[145]"
994 print " [[194]]uy [[211]]ell [211]ound [[207]]";sf$;" ";
996 print" [[198]8] to end [[210][197][212][213][210][206]] to [195]ontinue";:poke2023,160:poke56295,9
998 goto 1020
1000 poke214,23:print"[145]"
1002 print" [esc] to end ";
1010 rem
1020 mt=o:return
1030 rem
1040 rem
1050 printtab(20-len(m$)/2)m$: return
1060 rem
1070 hx=len(str$(a)):printtab(h-hx-1);:return
1080 rem
1090 poke204,0
1095 getan$:ifan$=""then1095
1100 ifan$="y"oran$="[217]"thenpoke2040,1:return
1102 ifan$="n"oran$="[206]"thenpoke2040,1:return
1104 poke54276,65:poke54276,64:goto1090
1110 ifasc(an$)=27thenesc=1
1130 rem
1140 forzz=1tolen(m$):printtab(38)mid$(m$,zz,1):print"[145] ";:ifsf=1thennext:print:return
1141 poke54283,129:poke54283,128:forl=1to20:nextl,zz:print:return
1150 rem
1160 poke214,19:print:print"[150][201][204][204][197][199][193][204] [197][206][212][210][217] - [212][210][217] [193][199][193][201][206]!";
1165 poke54276,33:poke54276,32:fort=1to1000:next:return
1170 rem
1180 rem
1190 forl=0tonl:poke